// 动态生成樱花
function createSakura() {
    const sakura = document.createElement('div');
    sakura.className = 'sakura';
    sakura.style.left = Math.random() * 100 + 'vw';
    sakura.style.animationDelay = Math.random() * 5 + 's';
    document.querySelector('.sakura-container').appendChild(sakura);
}
setInterval(createSakura, 300);

// 背景色随鼠标移动变化
document.addEventListener('mousemove', (e) => {
    const x = e.clientX / window.innerWidth * 100;
    const y = e.clientY / window.innerHeight * 100;
    document.body.style.background = `linear-gradient(${x}deg, #ff9a9e ${y}%, #fad0c4)`;
});

// 音效控制
function playBGM() {
    document.getElementById('bgm').play();
}

function playHeartbeat() {
    const audio = new Audio('assets/heartbeat.mp3');
    audio.play();
}